package cn.wsalix.install;

public enum AdminEnum {
	user("1", ""), role("2", ""), menu("3", ""),userrole("4", ""),rolemenu("4", ""),url("1", ""), ;
	private String code;
	private String title;

	AdminEnum(String code, String title) {
		this.code = code;
		this.title = title;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public static AdminEnum findByName(String name) {
		for (AdminEnum obj : AdminEnum.values()) {
			if (obj.name().equals(name)) {
				return obj;
			}
		}
		return null;
	}

	public static AdminEnum findByCode(String code) {
		for (AdminEnum obj : AdminEnum.values()) {
			if (obj.getCode().equals(code)) {
				return obj;
			}
		}
		return null;
	}
}
